package 设计模式.e_外观模式;

import java.util.Arrays;

/**
 * @author caihe
 * @date 2023/3/9 16:00
 */
public abstract class Person {

    public void wakeUp() {
        System.out.println("起床");
    }

    public void sleep() {
        System.out.println("睡觉");
    }

    public void study() {
        System.out.println("学习");
    }

    public void playGame() {
        System.out.println("玩游戏");
    }

    public void listenMusic() {
        System.out.println("听歌");
    }

    private void action(Action action) {
        switch (action) {
            case WAKEUP:
                wakeUp();
                break;
            case SLEEP:
                sleep();
                break;
            case STUDY:
                study();
                break;
            case PLAY_GAME:
                playGame();
                break;
            case LISTEN_MUSIC:
                listenMusic();
                break;
            default:
                System.out.println("暂不支持。。。");
                break;
        }
    }
    
    public void action(Action... actions) {
        Arrays.stream(actions).forEach(this::action);
    }
    
}
